<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
        <meta name="apple-mobile-web-app-capable" content="yes" />

        <!-- Base Css Files -->
        <link href="__PUBLIC__/statics/coco-chat/assets/libs/jqueryui/ui-lightness/jquery-ui-1.10.4.custom.min.css" rel="stylesheet" />
        <link href="__PUBLIC__/statics/coco-chat/assets/libs/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
        <link href="__PUBLIC__/statics/coco-chat/assets/libs/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
        <link href="__PUBLIC__/statics/coco-chat/assets/libs/fontello/css/fontello.css" rel="stylesheet" />
        <link href="__PUBLIC__/statics/coco-chat/assets/libs/animate-css/animate.min.css" rel="stylesheet" />
        <link href="__PUBLIC__/statics/coco-chat/assets/libs/nifty-modal/css/component.css" rel="stylesheet" />
        <link href="__PUBLIC__/statics/coco-chat/assets/libs/magnific-popup/magnific-popup.css" rel="stylesheet" /> 
        <link href="__PUBLIC__/statics/coco-chat/assets/css/style.css" rel="stylesheet" type="text/css" />
        <link href="__PUBLIC__/statics/coco-chat/assets/css/style-responsive.css" rel="stylesheet" />
        <link href="__PUBLIC__/statics/coco-chat/assets/libs/pace/pace.css" rel="stylesheet" />
        <link href="__PUBLIC__/statics/coco-chat/assets/libs/jquery-notifyjs/styles/metro/notify-metro.css" rel="stylesheet" type="text/css" />
        
        <!-- Extra CSS Files -->
      	<link href="__PUBLIC__/statics/coco-chat/assets/libs/bootstrap-validator/css/bootstrapValidator.min.css" rel="stylesheet"/>
      	
        <!-- Custom Css Files -->
        <link href="__HOME_CSS__/style.css"  rel="stylesheet" />
    </head>
    <body>
	<!-- Begin page -->
	<div>
		<div class="sub-header-title">
			<h2>
				确认支付
			</h2>
		</div>
		<div class="form-horizontal">
			<div class="form-group">
				<label class="col-sm-2 control-label">支付订单号</label>
				<div class="col-sm-5">
					<p class="help-block">{$pay['order_no']}</p>
				</div>
				<div class="col-sm-5">
					<p class="help-block"></p>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">标题</label>
				<div class="col-sm-5">
					<p class="help-block">{$pay['title']}</p>
				</div>
				<div class="col-sm-5">
					<p class="help-block"></p>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">描述</label>
				<div class="col-sm-5">
					<p class="help-block">{$pay['body']}</p>
				</div>
				<div class="col-sm-5">
					<p class="help-block"></p>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">金额</label>
				<div class="col-sm-5">
					<p class="help-block">{$pay['amount']}</p>
				</div>
				<div class="col-sm-5">
					<p class="help-block"></p>
				</div>
			</div>
		</div>
		<div class="widget-content padding">
			<form role="form" id="add-form" class="form-horizontal" method="post" action="{:U('Cash/confirm')}">

				<div class="form-group">
					<label for="check_code" class="col-sm-2 control-label">短信验证码</label>
					<div class="col-sm-5">
						<input type="text" class="form-control" id="check_code" name="check_code" value="">
					</div>
					<div class="col-sm-5">
						<button type="button" class="btn" id="btns">重新发送</button>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-offset-4 col-sm-4">
						<input type="hidden" value="{$order}" name="order_no">
						<button type="submit" class="btn btn-success">确认</button>
					</div>
				</div>
			</form>
		</div>


	</div>
	<!-- Base Js Files -->
	<script src="__PUBLIC__/statics/coco-chat/assets/libs/jquery/jquery-1.11.1.min.js"></script>
	<script src="__PUBLIC__/statics/coco-chat/assets/libs/bootstrap/js/bootstrap.min.js"></script>
	<script src="__PUBLIC__/statics/coco-chat/assets/libs/jqueryui/jquery-ui-1.10.4.custom.min.js"></script>
	<script src="__PUBLIC__/statics/coco-chat/assets/libs/jquery-ui-touch/jquery.ui.touch-punch.min.js"></script>
 	<script src="__PUBLIC__/statics/coco-chat/assets/libs/jquery-detectmobile/detect.js"></script>
	<script src="__PUBLIC__/statics/coco-chat/assets/libs/fastclick/fastclick.js"></script>
	<script src="__PUBLIC__/statics/coco-chat/assets/libs/jquery-slimscroll/jquery.slimscroll.js"></script>
	<script src="__PUBLIC__/statics/coco-chat/assets/libs/nifty-modal/js/classie.js"></script>
	<script src="__PUBLIC__/statics/coco-chat/assets/libs/nifty-modal/js/modalEffects.js"></script>
	<script src="__PUBLIC__/statics/coco-chat/assets/libs/jquery-notifyjs/notify.min.js"></script>
    <script src="__PUBLIC__/statics/coco-chat/assets/libs/jquery-notifyjs/styles/metro/notify-metro.js"></script>
	<script src="__PUBLIC__/statics/coco-chat/assets/libs/pace/pace.min.js"></script>
	
	<!-- Extra Js Files -->
	<script src="__PUBLIC__/statics/coco-chat/assets/libs/bootstrap-validator/js/bootstrapValidator.min.js"></script>
	<!-- Page Specific JS Libraries -->
	<script src="__PUBLIC__/statics/coco-chat/assets/libs/jquery-wizard/jquery.easyWizard.js"></script>
	<!-- Custom Js Files -->
	<script src="__HOME_JS__/common.js"></script>
	<!-- Custom Js Files -->
	<script src="__PUBLIC_JS__/sha1.js"></script>
	<script>
		$(function() {
			$('#myWizard').easyWizard({
				buttonsClass: 'btn btn-default',
				submitButtonClass: 'btn btn-primary'
			});
		});
		var wait=60;
		function time(o) {
			if (wait == 0) {
				o.removeAttribute("disabled");
				o.innerHTML="重新发送";
				wait = 60;
			} else {
				o.setAttribute("disabled", true);
				o.innerHTML="重新发送(" + wait + ")";
				wait--;
				setTimeout(function() {
							time(o);
						},
						1000);
			}
		}
		document.getElementById("btns").onclick=function(){
			time(this);
			$.ajax({
				type: "POST",
				url: "{:U('Cash/reSendSmsResult')}",
				data: $('#add-form').serialize(),
				dataType: "json",
				success: function(response){
					//弹出提示
					window.parent.layer.msg(response.message);
				}
			});
		};
		$('#add-form').bootstrapValidator({
			message: '',
			submitHandler: function(validator, form, submitButton) {
				// 用ajax提交表单
				$.post(form.attr('action'), form.serialize(), function(response) {
					$('#add-form').bootstrapValidator('disableSubmitButtons', false);
					//弹出提示
					window.parent.layer.msg(response.message);

					//根据状态显示通知
					if(response.status){
						notify("success",response.message);
						location.href="{:U('Cash/payList')}";

					}else{
						notify("error",response.message);
						$('#add-form').bootstrapValidator('disableSubmitButtons', false);
					}
				}, 'json');
			}
		});
	</script>
	</body>
</html>